home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / graphic / pvquan16.zip / QUANT / HECKBERT.H < prev    next >
C/C++ Source or Header  |  1992-11-30  |  2KB  |  43 lines

  1. /************************************************************************
  2.  *                                                                      *
  3.  *                  Copyright (c) 1991, Frank van der Hulst             *
  4.  *                          All Rights Reserved                         *
  5.  *                                                                      *
  6.  * Authors:                                                             *
  7.  *                FvdH - Frank van der Hulst (Wellington, NZ)           *
  8.  *                                                                      *
  9.  * Versions:                                                            *
  10.  *    V1.1 910626 FvdH - QUANT released for DBW_RENDER                  *
  11.  *    V1.2 911021 FvdH - QUANT released for PoV Ray                     *
  12.  *    V1.4 920303 FvdH - Ported to GNU                                  *
  13.  *    V1.6 921023 FvdH - Produce multi-image GIFs                       *
  14.  *                     - Port to OS/2 IBM C Set/2                       *
  15.  *                                                                      *
  16.  ************************************************************************/
  17. /* heckbert.h -- definitions for heckbert.c, virt_mem.c */
  18.  
  19. struct BOX {
  20.     double            weightedvar,            /* weighted variance */
  21.                         mean[3];                    /* centroid */
  22.     unsigned long     weight,                    /* # of pixels in box */
  23.                         freq[3][MAXCOLORS];    /* Projected frequencies */
  24.     int                 low[3], high[3];        /* Box extent */
  25. };
  26. typedef struct BOX Box;
  27.  
  28. Box *get_box(int n);
  29. Box *get_box_tmp(int n);
  30. void free_box(int n);
  31. void open_box_file(int colors);
  32. void close_box_file(void);
  33.  
  34. #define IN_COLOURS (1 << INPUT_BITS)
  35. #define BYTE_COUNT ((long)IN_COLOURS * IN_COLOURS * IN_COLOURS)
  36.             /* (2^INPUT_BITS)^3    */
  37.  
  38. extern unsigned long HUGE_PTR Histogram;
  39. extern unsigned char HUGE_PTR RGBmap;
  40.  
  41. int colorquant(int colors, int bits, int fast, double Cfactor);
  42. void QuantHistogram(Box *box);
  43.